﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using AvalonDock;
using WPFApplication.Controls;
using WPFModel.BusinessModelObject;

namespace WPFApplication
{
    /// <summary>
    /// Interaction logic for WindowMain.xaml
    /// </summary>
    public partial class WindowMain : Window
    {
        public WindowMain()
        {
            InitializeComponent();
        }

        #region Methods
        void NewDocument()
        {
            DocumentModel dc = new DocumentModel();
            dc.Title = "New";
            documentModels.Items.Add(dc);
            RichTextBox rtxt = new RichTextBox();
            dc.Content = rtxt;
            dc.Focus();
        }
        void showProperty()
        {
            LevelModel l = new LevelModel();

            NivelLifespan n = new NivelLifespan { Name="nivelUno", TemporalSupport = TypeNivelTemporalSupport.Interval };
            l.Nivel = n;

            AtributoNoEspTemp a = new AtributoNoEspTemp();
            a.Name = "Atributo Uno";
            a.TemporalSupport = TypeAtributoTemporalSupport.Instant;
            a.Key = TypeKey.Y;
            a.DataType = TypeData.Varchar2;
            l.Atributos.Add(a);

            properties.ShowProperties<LevelModel, AtributoNoEspTemp>(l, (AtributoNoEspTemp)l.Atributos[0]);
        }
        #endregion

        private void mnuNew_Click(object sender, RoutedEventArgs e)
        {
            NewDocument();
        }

        


        private void btnNuevo_Click(object sender, RoutedEventArgs e)
        {
            NewDocument();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            showProperty();
        }

    }
}
